home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2259 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Use of getch()...
  5. Date: Sat, 20 Jan 96 01:31:13 GMT
  6. Organization: none
  7. Message-ID: <822101473snz@genesis.demon.co.uk>
  8. References: <4do95b$jio@klein.delphi.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4do95b$jio@klein.delphi.com>
  15.            stucros@mci.newscorp.com "Stuart Crosby" writes:
  16.  
  17. >I need to use the function getch() in a loop but I also need for a null
  18. >character to be returned during each iteration if the user has not 
  19. >entered a character. I need this so that the program will not stop and 
  20. >wait for input at the point that I have getch() in the routine.  Is this 
  21. >possible?
  22.  
  23. getch() isn't a function that is defined by the C language so its actual
  24. functionality depends upon your particular system. One approach may
  25. be to test whether the input buffer is empty and call getch() only when
  26. it is not. The comp.lang.c FAQ has some pointers in this area. in section
  27. 19. You can ftp it from rtfm.mit.edu under /pub/usenet/comp.lang.c.
  28.  
  29. -- 
  30. -----------------------------------------
  31. Lawrence Kirby | fred@genesis.demon.co.uk
  32. Wilts, England | 70734.126@compuserve.com
  33. -----------------------------------------
  34.